package com.example.gw_back_end.controller;

import com.example.gw_back_end.domain.PageParam;
import com.example.gw_back_end.domain.Result;
import com.example.gw_back_end.service.PostCommentService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("comment")
public class CommentController {
    private final PostCommentService postCommentService;
    public CommentController(PostCommentService postCommentService) {
        this.postCommentService = postCommentService;
    }

    // 获取帖子评论列表
    @GetMapping("get_post_comment_list")
    public Result getPostCommentList(@ModelAttribute PageParam pageParam, @RequestParam Integer postId) {
        return Result.success(postCommentService.getPostCommentByPage(pageParam,postId));
    }
}
